home *** CD-ROM | disk | FTP | other *** search
/ Medabots Cardz / Medabots CD Cardz Metabee.bin / pc / assets / metabee.dxr / 00268_Script_268 < prev    next >
Text File  |  2001-12-07  |  9KB  |  289 lines

  1. property minuteman, tempdigits, tempscore, digit_one, digit_two, digit_three, digit_four, brassurl, tempscoreone, tempscoretwo, tempscorethree
  2. global thescore, finalcode, scoredigits, timescore, gotobrassurl, myFile, squam, oldscore
  3.  
  4. on beginsprite me
  5.   set the floatPrecision = 0
  6.   squam = getOSdirectory()&"\"
  7.   if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
  8.   myFile = new(xtra "fileio") -- Create an instance of FileIO
  9.   --  openFile(myFile,the moviePath&"info.txt",1) --Open the file with read access
  10.   openFile(myFile,squam&"infom.txt",1) --Open the file with read access
  11.   myVariable = readFile(myFile) --set the variable 'myVariable' to the text of the file 'info.txt'
  12.   if readFile(myFile)=VOID then --checks to see if this file exists
  13.     oldscore = 0
  14.   else
  15.     oldscore = myVariable
  16.     closeFile(myFile) -- Close the file
  17.   end if
  18.   myFile = 0 -- Dispose of the instance
  19.   
  20.   
  21.   minuteman = timescore/60
  22.   if minuteman < 60 then
  23.     thescore = 10
  24.   else if minuteman > 59 and minuteman < 120 then
  25.     thescore = 9
  26.   else if minuteman > 119 and minuteman < 180 then
  27.     thescore = 8
  28.   else if minuteman > 179 and minuteman < 240 then
  29.     thescore = 7
  30.   else if minuteman > 239 and minuteman < 360 then
  31.     thescore = 6
  32.   else if minuteman > 359 and minuteman < 420 then
  33.     thescore = 5
  34.   else if minuteman > 419 and minuteman < 480 then
  35.     thescore = 4
  36.   else if minuteman > 479 and minuteman < 540 then
  37.     thescore = 3
  38.   else if minuteman > 539 and minuteman < 600 then
  39.     thescore = 2
  40.   else
  41.     thescore = 1
  42.   end if
  43.   thescore = thescore + oldscore
  44.   put thescore into member("holdscore")
  45.   
  46.   if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
  47.   myFile = new(xtra "fileio")    -- Create an instance of FileIO
  48.   --  openFile (myFile, the moviePath &"info.txt",0)--Open the file with R/W access  
  49.   openFile (myFile, squam&"infom.txt",0)--Open the file with R/W access  
  50.   delete(myFile) --deletes the file
  51.   --  createFile (myFile, the moviePath &"info.txt") --creates the file again
  52.   createFile (myFile, squam&"infom.txt") --creates the file again
  53.   --  openFile(myFile,the moviePath &"info.txt",0) --Open the file with R/W access
  54.   openFile(myFile, squam&"infom.txt",0) --Open the file with R/W access
  55.   --  mySaveString = thescore --puts the contents of the field 'input' into the variable mySaveString
  56.   mySaveString = member("holdscore").text
  57.   writeString(myFile,mySaveString) --writes text to the file
  58.   
  59.   closeFile(myFile) -- Close the file 
  60.   myFile = 0 -- Dispose of the instance
  61.   
  62.   --  put minuteman into member ("timedisplay")
  63.   --  
  64.   brassurl = "http://www.medabots.com/rewards/coding/rewards_give.pl?b=kmghoinmuhhv"
  65.   
  66.   if thescore > 10000 then
  67.     thescore = 9999
  68.   end if
  69.   
  70.   if thescore > 0 and thescore <10 then
  71.     scoredigits = 1
  72.     tempscore = thescore
  73.     tempdigits = 1
  74.   else if thescore > 9 and thescore <100 then
  75.     scoredigits = 2
  76.     tempscore = thescore
  77.     tempdigits = 2
  78.   else if thescore >99 and thescore < 1000 then
  79.     scoredigits = 3
  80.     tempscore = thescore
  81.     tempdigits = 3
  82.   else if thescore >999 and thescore < 10000 then
  83.     scoredigits = 4
  84.     tempscore = thescore
  85.     tempdigits = 4
  86.   end if
  87.   
  88.   --  Four Figures
  89.   if tempdigits = 4 then
  90.     if tempscore > 999 and tempscore <2000 then
  91.       digit_four = "q"
  92.       tempscore = tempscore - 1000
  93.       tempdigits = 3
  94.     end if
  95.     if tempscore > 1999 and tempscore <3000 then
  96.       digit_four = "u"
  97.       tempscore = tempscore - 2000
  98.       tempdigits = 3
  99.     end if
  100.     if tempscore > 2999 and tempscore <4000 then
  101.       digit_four = "j"
  102.       tempscore = tempscore - 3000
  103.       tempdigits = 3
  104.     end if
  105.     if tempscore > 3999 and tempscore <5000 then
  106.       digit_four = "c"
  107.       tempscore = tempscore - 4000
  108.       tempdigits = 3
  109.     end if
  110.     if tempscore > 4999 and tempscore <6000 then
  111.       digit_four = "k"
  112.       tempscore = tempscore - 5000
  113.       tempdigits = 3
  114.     end if
  115.     if tempscore > 5999 and tempscore <7000 then
  116.       digit_four = "b"
  117.       tempscore = tempscore - 6000
  118.       tempdigits = 3
  119.     end if
  120.     if tempscore > 6999 and tempscore <8000 then
  121.       digit_four = "r"
  122.       tempscore = tempscore - 7000
  123.       tempdigits = 3
  124.     end if
  125.     if tempscore > 7999 and tempscore <9000 then
  126.       digit_four = "w"
  127.       tempscore = tempscore - 8000
  128.       tempdigits = 3
  129.     end if
  130.     if tempscore > 8999 and tempscore <10000 then
  131.       digit_four = "n"
  132.       tempscore = tempscore - 9000
  133.       tempdigits = 3
  134.     end if
  135.   end if
  136.   
  137.   
  138.   
  139.   
  140.   --  Three Figures
  141.   if tempdigits = 3 then
  142.     if tempscore < 99 then
  143.       digit_three = "x"
  144.       tempscore = tempscore
  145.       tempdigits = 2
  146.     end if
  147.     if tempscore > 99 and tempscore <200 then
  148.       digit_three = "q"
  149.       tempscore = tempscore - 100
  150.       tempdigits = 2
  151.     end if
  152.     if tempscore > 199 and tempscore <300 then
  153.       digit_three = "u"
  154.       tempscore = tempscore - 200
  155.       tempdigits = 2
  156.     end if
  157.     if tempscore > 299 and tempscore <400 then
  158.       digit_three = "j"
  159.       tempscore = tempscore - 300
  160.       tempdigits = 2
  161.     end if
  162.     if tempscore > 399 and tempscore <500 then
  163.       digit_three = "c"
  164.       tempscore = tempscore - 400
  165.       tempdigits = 2
  166.     end if
  167.     if tempscore > 499 and tempscore <600 then
  168.       digit_three = "k"
  169.       tempscore = tempscore - 500
  170.       tempdigits = 2
  171.     end if
  172.     if tempscore > 599 and tempscore <700 then
  173.       digit_three = "b"
  174.       tempscore = tempscore - 600
  175.       tempdigits = 2
  176.     end if
  177.     if tempscore > 699 and tempscore <800 then
  178.       digit_three = "r"
  179.       tempscore = tempscore - 700
  180.       tempdigits = 2
  181.     end if
  182.     if tempscore > 799 and tempscore <900 then
  183.       digit_three = "w"
  184.       tempscore = tempscore - 800
  185.       tempdigits = 2
  186.     end if
  187.     if tempscore > 899 and tempscore <1000 then
  188.       digit_three = "n"
  189.       tempscore = tempscore - 900
  190.       tempdigits = 2
  191.     end if
  192.   end if
  193.   
  194.   
  195.   --  Two Figures
  196.   if tempdigits = 2 then
  197.     if tempscore < 10 then
  198.       digit_two = "x"
  199.       tempscore = tempscore
  200.       tempdigits = 1
  201.     end if
  202.     
  203.     if tempscore > 9 and tempscore <20 then
  204.       digit_two = "q"
  205.       tempscore = tempscore - 10
  206.       tempdigits = 1
  207.     end if
  208.     if tempscore > 19 and tempscore <30 then
  209.       digit_two = "u"
  210.       tempscore = tempscore - 20
  211.       tempdigits = 1
  212.     end if
  213.     if tempscore > 29 and tempscore <40 then
  214.       digit_two = "j"
  215.       tempscore = tempscore - 30
  216.       tempdigits = 1
  217.     end if
  218.     if tempscore > 39 and tempscore <50 then
  219.       digit_two = "c"
  220.       tempscore = tempscore - 40
  221.       tempdigits = 1
  222.     end if
  223.     if tempscore > 49 and tempscore <60 then
  224.       digit_two = "k"
  225.       tempscore = tempscore - 50
  226.       tempdigits = 1
  227.     end if
  228.     if tempscore > 59 and tempscore <70 then
  229.       digit_two = "b"
  230.       tempscore = tempscore - 60
  231.       tempdigits = 1
  232.     end if 
  233.     if tempscore > 69 and tempscore <80 then
  234.       digit_two = "r"
  235.       tempscore = tempscore - 70
  236.       tempdigits = 1
  237.     end if
  238.     if tempscore > 79 and tempscore <90 then
  239.       digit_two = "w"
  240.       tempscore = tempscore - 80
  241.       tempdigits = 1
  242.     end if
  243.     if tempscore > 89 and tempscore <100 then
  244.       digit_two = "n"
  245.       tempscore = tempscore - 90
  246.       tempdigits = 1
  247.     end if
  248.     
  249.   end if
  250.   --  One Figure
  251.   if tempdigits = 1 then
  252.     if tempscore = 0 then
  253.       digit_one = "x"
  254.     else if tempscore = 1 then
  255.       digit_one = "q"
  256.     else if tempscore = 2 then
  257.       digit_one = "u"
  258.     else if tempscore = 3 then
  259.       digit_one = "j"
  260.     else if tempscore = 4 then
  261.       digit_one = "c"
  262.     else if tempscore = 5 then
  263.       digit_one = "k"
  264.     else if tempscore = 6 then
  265.       digit_one = "b"
  266.     else if tempscore = 7 then
  267.       digit_one = "r"
  268.     else if tempscore = 8 then
  269.       digit_one = "w"
  270.     else if tempscore = 9 then
  271.       digit_one = "n"
  272.     end if
  273.   end if
  274.   
  275.   if scoredigits = 1 then
  276.     finalcode = digit_one
  277.   else if scoredigits = 2 then
  278.     finalcode = digit_two&digit_one
  279.   else if scoredigits = 3 then
  280.     finalcode = digit_three&digit_two&digit_one
  281.   else if scoredigits = 4 then
  282.     finalcode = digit_four&digit_three&digit_two&digit_one
  283.   end if
  284.   
  285.   --  put brassurl&finalcode into member("urldisplay")
  286.   gotobrassurl = brassurl&finalcode
  287. end
  288.  
  289.